
#ifndef _TTG_SERVICES_PIPELINE_TASK_INFO_
#define _TTG_SERVICES_PIPELINE_TASK_INFO_
#include "Common/Definitions.h"

#ifdef TTG_PL_VISUALIZER

#include "Common/Structures.h"
#include "Common/Extras.h"

namespace ttg_internal
{
	namespace pipeline
	{
		//Contains some additional information about task.
		//Will be used in TTG_PIPELINE_VISUALIZER mode only.
		class PipelineTaskInfo :public ttg::structures::TaggedObject<std::string>
		{
			private:
				double start_time;		//time of start.
				double elapsed_time;	//real time of performing.
				double expected_time;	//expected time of performing.
			public:
				//Creates default information for task.
				PipelineTaskInfo();
				//Creates requires infoormation for task.
				PipelineTaskInfo(double start_time,
								 double elapsed_time,
								 double expected_time);
				//Returns time of start.
				inline double getStartTime() const
						{ return start_time; }
				//Returns real time of performing.
				inline double getElapsedTime() const
						{ return elapsed_time; }
				//Returns expected time of performing.
				inline double getExpectedTime() const
						{ return expected_time; }
				//Stores current state to xml ("Task" section will be created).
				//In case of error throws Error().
				void store(ttg::extras::XMLTree &xml);
				//Creates TaskInfo according to xml ("Task" section is expected).
				//In case of error throws Error().
				static PipelineTaskInfo create(ttg::extras::XMLTree &xml);
		};
	}
}

#endif

#endif
